<?php

/**
 * Example of use of datagrid
 *
 */
class Model_ExampleGrid extends Zend_DataGrid
{

    public function init()
    {
        parent::init();

        $editActionUrl = $this->getView()->url(array('module'=>'mnu','controller'=>'liste','action'=>'edit'));
        $detailsActionUrl = $this->getView()->url(array('module'=>'mnu','controller'=>'liste','action'=>'view'));

        $literal = new Zend_DataGrid_Column_Literal('#');
        $literal->setHeaderText(' # ')
           ->setDataField('colName');

        $literal1 = new Zend_DataGrid_Column_Literal('alias');
        $literal1->setHeaderText('ColomHeaderText')
                 ->setDataField('colName');

        $literal2 = new Zend_DataGrid_Column_Literal('desc');
        $literal2->setHeaderText('Description')
                  ->setDataField('colName')
                  ->addFilter('StringToLower');

        $checkbox = new Zend_DataGrid_Column_Checkbox('id[]');
        $checkbox->setHeaderText('')
                 ->setDataField('mnu_lis_id');

        $hyperLink = new Zend_DataGrid_Column_HyperLink('title');
        $hyperLink->setHeaderText('Nom du menu')
                  ->setDataField('mnu_elt_title')
                  ->setTreeLevelDataField('mnu_list_tree')
                  ->setDataUrlField('mnu_elt_id')
                  ->setDataUrlFormat($editActionUrl.'/id/%1$d');

        $this->addColumn($literal)
             ->addColumn($literal1)
             ->addColumn($literal2);

        $this->setName('myListeGrid')
             ->setItemCountPerPage(200);


        return $this;
    }

}

?>
